Analysis date: 2023-09-07

Depends on

DIPG_FirstBatch_DataProcessing Script

load("../Data/Cache/Xenografts_Batch1_2_DataProcessing.RData")

TODO

  • Do differential abudance analysis for prep batch and mass spec run

Setup

Load libraries and functions

Analysis

DEP

Tyrosine all

Each condition vs ctrl

data_diff_ctrl_vs_E_pY <- test_diff(pY_se_Set2, type="manual", test = "E_vs_ctrl")
## Tested contrasts: E_vs_ctrl
dep_ctrl_vs_E_pY <- add_rejections_SH(data_diff_ctrl_vs_E_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Volcano(dep_ctrl_vs_E_pY, contrast = "E_vs_ctrl", 
                add_names = TRUE,
                additional_title = "pY")
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
Return_DEP_Hits_Plots(data = pY_Set2_form, dep_ctrl_vs_E_pY, comparison = "E_vs_ctrl_diff")
## Warning: Using an external vector in selections was deprecated in tidyselect 1.1.0.
## ℹ Please use `all_of()` or `any_of()` instead.
##   # Was:
##   data %>% select(comparison)
## 
##   # Now:
##   data %>% select(all_of(comparison))
## 
## See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## 'select()' returned 1:many mapping between keys and columns
## Loading required namespace: reactome.db
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                                            pathway      pval
## 1: A tetrasaccharide linker sequence is required for GAG synthesis 0.8348968
## 2:                                       ABC transporter disorders 0.3705463
## 3:                          ABC-family proteins mediated transport 0.2386935
## 4:                       ADP signalling through P2Y purinoceptor 1 0.6960600
## 5:                                           ALK mutants bind TKIs 0.3320388
## 6:               APC/C-mediated degradation of cell cycle proteins 0.1331658
##         padj    log2err         ES        NES size              leadingEdge
## 1: 0.9569891 0.05101141  0.4675325  0.7116487    2                6385,1464
## 2: 0.9198162 0.10632326 -0.5416351 -1.1266124    5      5696,5687,5692,5694
## 3: 0.8924453 0.14122512 -0.5585935 -1.2376386    6 5696,5687,1965,5692,5694
## 4: 0.9569891 0.05947603  0.5609045  0.8537737    2                1432,6714
## 5: 0.9198162 0.10063339  0.8341969  1.1265638    1                     1213
## 6: 0.8321409 0.19381330 -0.6290186 -1.3936748    6            983,5696,5687
data_diff_EC_vs_ctrl_pY <- test_diff(pY_se_Set2, type="manual", test = "EC_vs_ctrl")
## Tested contrasts: EC_vs_ctrl
dep_EC_vs_ctrl_pY <- add_rejections_SH(data_diff_EC_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Volcano(dep_EC_vs_ctrl_pY, contrast = "EC_vs_ctrl", 
                 add_names = TRUE,
                additional_title = "pY") 
Return_DEP_Hits_Plots(data = pY_Set2_form, dep_EC_vs_ctrl_pY, comparison = "EC_vs_ctrl_diff")
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                                            pathway      pval
## 1: A tetrasaccharide linker sequence is required for GAG synthesis 0.3238095
## 2:                                       ABC transporter disorders 0.3942598
## 3:                          ABC-family proteins mediated transport 0.4770115
## 4:                       ADP signalling through P2Y purinoceptor 1 0.8547619
## 5:                                           ALK mutants bind TKIs 0.6693227
## 6:               APC/C-mediated degradation of cell cycle proteins 0.3318966
##         padj    log2err         ES        NES size              leadingEdge
## 1: 0.7103992 0.11524000  0.6805195  1.1003725    2                1464,6385
## 2: 0.7171934 0.07687367 -0.5275245 -1.0495781    5      5692,5696,5693,5687
## 3: 0.7859918 0.06479434 -0.4748405 -1.0046256    6 5692,5696,5693,5687,1965
## 4: 0.9221326 0.06103637  0.4415584  0.7139821    2                1432,6714
## 5: 0.8590082 0.06421409  0.6658031  0.8945496    1                     1213
## 6: 0.7103992 0.08336341 -0.5311741 -1.1238113    6  5692,983,5696,5693,5687
Plot_Enrichment_Single_Pathway(dep_EC_vs_ctrl_pY, comparison = "EC_vs_ctrl_diff", 
                               pw = "Epigenetic regulation of gene expression")
data_diff_EBC_vs_ctrl_pY <- test_diff(pY_se_Set2, type="manual", test = "EBC_vs_ctrl")
## Tested contrasts: EBC_vs_ctrl
dep_EBC_vs_ctrl_pY <- add_rejections_SH(data_diff_EBC_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Volcano(dep_EBC_vs_ctrl_pY, contrast = "EBC_vs_ctrl", 
                 add_names = TRUE,
                additional_title = "pY")
Return_DEP_Hits_Plots(data = pY_Set2_form, dep_EBC_vs_ctrl_pY, comparison = "EBC_vs_ctrl_diff")
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                                            pathway      pval
## 1: A tetrasaccharide linker sequence is required for GAG synthesis 0.1926346
## 2:                                       ABC transporter disorders 0.4444444
## 3:                          ABC-family proteins mediated transport 0.6400938
## 4:                       ADP signalling through P2Y purinoceptor 1 0.9214176
## 5:                                           ALK mutants bind TKIs 0.2359551
## 6:               APC/C-mediated degradation of cell cycle proteins 0.2532239
##         padj    log2err         ES        NES size        leadingEdge
## 1: 0.5037070 0.16957064  0.7324675  1.2352115    2               1464
## 2: 0.6870382 0.05986031 -0.5053256 -1.0226331    5     5693,5696,5692
## 3: 0.8241230 0.04165568 -0.4223236 -0.8943592    6     5693,5696,5692
## 4: 0.9829994 0.03745842 -0.4311688 -0.6839154    2          6714,1432
## 5: 0.5422652 0.12043337 -0.8756477 -1.1854109    1               1213
## 6: 0.5604280 0.08705159 -0.5550656 -1.1754683    6 983,5693,5696,5692

EC vs E

data_diff_EC_vs_E_pY <- test_diff(pY_se_Set2, type = "manual", 
                              test = c("EC_vs_E"))
## Tested contrasts: EC_vs_E
dep_EC_vs_E_pY <- add_rejections_SH(data_diff_EC_vs_E_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Volcano(dep_EC_vs_E_pY, additional_title = "pY", contrast = "EC_vs_E", proteins_of_interest = "EGFR")
Return_DEP_Hits_Plots(data = pY_Set2_form, dep_EC_vs_E_pY, comparison = "EC_vs_E_diff")
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns
##                                                            pathway      pval
## 1: A tetrasaccharide linker sequence is required for GAG synthesis 0.5179063
## 2:                                       ABC transporter disorders 0.4489796
## 3:                          ABC-family proteins mediated transport 0.5688406
## 4:                       ADP signalling through P2Y purinoceptor 1 0.7824726
## 5:                                           ALK mutants bind TKIs 0.2914172
## 6:               APC/C-mediated degradation of cell cycle proteins 0.7487923
##         padj    log2err         ES        NES size leadingEdge
## 1: 0.7907865 0.09497515  0.5714286  0.9433919    2   1464,6385
## 2: 0.7657428 0.06197627 -0.5443490 -1.0276232    5   5692,5693
## 3: 0.8342146 0.04840876 -0.4725743 -0.9392741    6   5692,5693
## 4: 0.9365650 0.04567904 -0.5220779 -0.8037836    2   6714,1432
## 5: 0.6904262 0.11056472 -0.8549223 -1.1480337    1        1213
## 6: 0.9212021 0.03576908 -0.4101428 -0.8151871    6   5692,5693

## Note: Row-scaling applied for this heatmap

#data_results <- get_df_long(dep)

EBC vs EC

data_diff_EBC_vs_EC_pY <- test_diff(pY_se_Set2, type = "manual", 
                              test = c("EBC_vs_EC"))
## Tested contrasts: EBC_vs_EC
dep_EBC_vs_EC_pY <- add_rejections_SH(data_diff_EBC_vs_EC_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Volcano(dep_EBC_vs_EC_pY, contrast = "EBC_vs_EC",  add_names = TRUE, additional_title = "pY")
Return_DEP_Hits_Plots(data = pY_Set2_form, dep_EBC_vs_EC_pY, comparison = "EBC_vs_EC_diff")
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns
##                                                            pathway      pval
## 1: A tetrasaccharide linker sequence is required for GAG synthesis 0.2434783
## 2:                                       ABC transporter disorders 0.4963054
## 3:                          ABC-family proteins mediated transport 0.6213705
## 4:                       ADP signalling through P2Y purinoceptor 1 0.8158295
## 5:                                           ALK mutants bind TKIs 0.1621622
## 6:               APC/C-mediated degradation of cell cycle proteins 0.3275261
##         padj    log2err         ES        NES size        leadingEdge
## 1: 0.7131233 0.15114876  0.7194805  1.1675565    2          1464,6385
## 2: 0.8009745 0.05559471 -0.5052912 -0.9897829    5     5693,5687,5696
## 3: 0.8826364 0.04258778 -0.4373559 -0.8979332    6     5693,5687,5696
## 4: 0.9335254 0.04250232 -0.5012987 -0.7823006    2          6714,1432
## 5: 0.5702233 0.15114876 -0.9222798 -1.2340474    1               1213
## 6: 0.8009745 0.07289386 -0.5410779 -1.1108843    6 5693,983,5687,5696
## Warning in max(screen_pval05_pos[, logFcColStr]): no non-missing arguments to
## max; returning -Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(cs1s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs1s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs2s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs2s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs3s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs3s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

## Note: Row-scaling applied for this heatmap

#data_results <- get_df_long(dep)

Save

rowData(dep_ctrl_vs_E_pY) %>% as_tibble() %>% select(HGNC_Symbol, E_vs_ctrl_diff) %>% write.table("../Data/Kinase_enrichment/Batch1_Set2_E_vs_ctrl_pY_forstring.txt", quote = F, row.names = F, col.names = F, sep = "\t")
rowData(dep_EC_vs_ctrl_pY) %>% as_tibble() %>% select(HGNC_Symbol, EC_vs_ctrl_diff) %>% write.table("../Data/Kinase_enrichment/Batch1_Set2_EC_vs_ctrl_pY_forstring.txt", quote = F, row.names = F, col.names = F, sep = "\t")

Session Info

sessionInfo()
## R version 4.2.3 (2023-03-15)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Big Sur ... 10.16
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] lubridate_1.9.2             forcats_1.0.0              
##  [3] stringr_1.5.0               dplyr_1.1.2                
##  [5] purrr_1.0.2                 readr_2.1.4                
##  [7] tidyr_1.3.0                 tibble_3.2.1               
##  [9] ggplot2_3.4.2               tidyverse_2.0.0            
## [11] mdatools_0.14.0             SummarizedExperiment_1.28.0
## [13] GenomicRanges_1.50.2        GenomeInfoDb_1.34.9        
## [15] MatrixGenerics_1.10.0       matrixStats_1.0.0          
## [17] DEP_1.20.0                  org.Hs.eg.db_3.16.0        
## [19] AnnotationDbi_1.60.2        IRanges_2.32.0             
## [21] S4Vectors_0.36.2            Biobase_2.58.0             
## [23] BiocGenerics_0.44.0         fgsea_1.24.0               
## 
## loaded via a namespace (and not attached):
##   [1] circlize_0.4.15        fastmatch_1.1-3        plyr_1.8.8            
##   [4] igraph_1.5.1           gmm_1.8                lazyeval_0.2.2        
##   [7] shinydashboard_0.7.2   crosstalk_1.2.0        BiocParallel_1.32.6   
##  [10] digest_0.6.33          foreach_1.5.2          htmltools_0.5.6       
##  [13] fansi_1.0.4            magrittr_2.0.3         memoise_2.0.1         
##  [16] cluster_2.1.4          doParallel_1.0.17      tzdb_0.4.0            
##  [19] limma_3.54.2           ComplexHeatmap_2.14.0  Biostrings_2.66.0     
##  [22] imputeLCMD_2.1         sandwich_3.0-2         timechange_0.2.0      
##  [25] colorspace_2.1-0       blob_1.2.4             xfun_0.40             
##  [28] crayon_1.5.2           RCurl_1.98-1.12        jsonlite_1.8.7        
##  [31] impute_1.72.3          zoo_1.8-12             iterators_1.0.14      
##  [34] glue_1.6.2             hash_2.2.6.2           gtable_0.3.3          
##  [37] zlibbioc_1.44.0        XVector_0.38.0         GetoptLong_1.0.5      
##  [40] DelayedArray_0.24.0    shape_1.4.6            scales_1.2.1          
##  [43] pheatmap_1.0.12        vsn_3.66.0             mvtnorm_1.2-2         
##  [46] DBI_1.1.3              Rcpp_1.0.11            plotrix_3.8-2         
##  [49] mzR_2.32.0             viridisLite_0.4.2      xtable_1.8-4          
##  [52] clue_0.3-64            reactome.db_1.82.0     bit_4.0.5             
##  [55] preprocessCore_1.60.2  sqldf_0.4-11           MsCoreUtils_1.10.0    
##  [58] DT_0.28                htmlwidgets_1.6.2      httr_1.4.6            
##  [61] gplots_3.1.3           RColorBrewer_1.1-3     ellipsis_0.3.2        
##  [64] farver_2.1.1           pkgconfig_2.0.3        XML_3.99-0.14         
##  [67] sass_0.4.7             utf8_1.2.3             STRINGdb_2.10.1       
##  [70] labeling_0.4.2         tidyselect_1.2.0       rlang_1.1.1           
##  [73] later_1.3.1            munsell_0.5.0          tools_4.2.3           
##  [76] cachem_1.0.8           cli_3.6.1              gsubfn_0.7            
##  [79] generics_0.1.3         RSQLite_2.3.1          fdrtool_1.2.17        
##  [82] evaluate_0.21          fastmap_1.1.1          mzID_1.36.0           
##  [85] yaml_2.3.7             knitr_1.43             bit64_4.0.5           
##  [88] caTools_1.18.2         KEGGREST_1.38.0        ncdf4_1.21            
##  [91] mime_0.12              compiler_4.2.3         rstudioapi_0.15.0     
##  [94] plotly_4.10.2          png_0.1-8              affyio_1.68.0         
##  [97] stringi_1.7.12         bslib_0.5.0            highr_0.10            
## [100] MSnbase_2.24.2         lattice_0.21-8         ProtGenerics_1.30.0   
## [103] Matrix_1.6-0           tmvtnorm_1.5           vctrs_0.6.3           
## [106] pillar_1.9.0           norm_1.0-11.1          lifecycle_1.0.3       
## [109] BiocManager_1.30.22    jquerylib_0.1.4        MALDIquant_1.22.1     
## [112] GlobalOptions_0.1.2    data.table_1.14.8      cowplot_1.1.1         
## [115] bitops_1.0-7           httpuv_1.6.11          R6_2.5.1              
## [118] pcaMethods_1.90.0      affy_1.76.0            promises_1.2.1        
## [121] KernSmooth_2.23-22     codetools_0.2-19       MASS_7.3-60           
## [124] gtools_3.9.4           assertthat_0.2.1       chron_2.3-61          
## [127] proto_1.0.0            rjson_0.2.21           withr_2.5.0           
## [130] GenomeInfoDbData_1.2.9 parallel_4.2.3         hms_1.1.3             
## [133] grid_4.2.3             rmarkdown_2.23         shiny_1.7.4.1
knitr::knit_exit()